:root {
  --el-border-radius-base: 2px;
  --el-color-white-rgb: 255, 255, 255;
  --el-color-black-rgb: 0, 0, 0;
}

.el-tag {
  --el-tag-border-radius: var(--el-border-radius-base);
}

.el-notification {
  --el-notification-radius: var(--el-border-radius-base) !important;
}

.el-input__prefix,
.el-input__suffix {
  align-items: center;
}

.el-message__closeBtn {
  position: absolute;
  color: var(--el-message-close-icon-color);
}

.el-overlay {
  /* stylelint-disable-next-line color-function-notation */
  background: rgba(var(--el-overlay-color-rgb), 0.25);
  backdrop-filter: blur(8px);
}

.el-select-dropdown__item {
  padding: 0 20px;
}

.el-form {
  .el-form-item {
    margin-bottom: 0;
  }

  &.el-form--inline {
    margin-top: -6px;
    margin-right: -6px;
    margin-left: -6px;

    .el-form-item+.el-form-item {
      margin-top: 0;
      margin-left: 0;
    }

    .el-form-item {
      margin-right: 0;
    }

    .el-form-item__label {
      margin: 6px;
    }
  }

  &.el-form--label-top {
    margin-right: -6px;
    margin-left: -6px;

    .el-form-item {
      .el-form-item__label {
        margin: 6px;
        margin-bottom: 0;
      }
    }
  }

  .el-form-item+.el-form-item {
    margin-top: 6px;
  }

  .el-form-item__label {
    align-items: center;
    margin: 6px 6px 6px 0;
    padding: 0;
  }

  .el-form-item__content {
    > .el-button,
    > .el-link,
    > .el-tag,
    > .el-check-tag,
    > .el-select,
    > .el-input,
    > .el-checkbox,
    > .el-checkbox-group>.el-checkbox,
    > .el-checkbox-group.checkbox-button,
    > .el-radio,
    > .el-radio-group>.el-radio,
    > .el-radio-group.radio-button,
    > .el-switch,
    > .el-textarea,
    > .el-cascader,
    > .el-color-picker,
    > .el-select-v2,
    > .el-input-number,
    > .el-date-editor,
    > .el-slider,
    > .el-rate,
    > .el-transfer,
    > .el-upload-wrap {
      margin: 6px;
    }

    > .el-form-item__error {
      left: 6px;
      margin-top: -5px;
    }

    .el-select,
    .el-cascader,
    .el-select-v2 {
      flex: 1;
    }
  }

  .el-link {
    line-height: 20px;

    > .el-icon {
      margin-right: 5px;
    }
  }

  .el-button-group {
    margin: 6px;

    .el-button {
      margin: 0;
    }
  }

  .el-cascader__tags {
    z-index: 1;
  }

  .el-rate__item {
    display: inline-flex;
  }
}

.el-check-tag {
  font-weight: normal;
}

.el-alert--success.is-light {
  border: 1px solid var(--el-color-success);
}

.el-alert--warning.is-light {
  border: 1px solid var(--el-color-warning);
}

.el-alert--error.is-light {
  border: 1px solid var(--el-color-error);
}

.el-alert--info.is-light {
  border: 1px solid var(--el-color-info);
}

.el-alert {
  --el-alert-title-font-size: 14px;
}

.el-steps {
  .el-step__head.is-success {
    .el-step__line {
      background-color: var(--el-color-success);
    }
  }
}

.el-select--disabled {
  .el-input__prefix {
    cursor: not-allowed !important;
  }
}

.el-picker-panel .el-time-panel {
  background-color: var(--el-bg-color-overlay);
}

.el-space {
  margin-bottom: 0 !important;
}

input {
  &:-webkit-autofill,
  &:-webkit-autofill:hover,
  &:-webkit-autofill:focus,
  &:-webkit-autofill:active {
    transition: color 99999s ease-out 99999s, background-color 99999s ease-out 99999s;
  }
}

.el-dialog {
  display: flex;
  flex-direction: column;

  .el-dialog__header {
    margin: 0;
    padding: 15px var(--el-space);

    .el-dialog__headerbtn {
      top: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  .el-dialog__body {
    flex: 1;
    padding: var(--el-space);
    border-top: 1px solid var(--el-border-color-lighter);
    border-bottom: 1px solid var(--el-border-color-lighter);
  }

  .el-dialog__footer {
    padding: 15px var(--el-space);
  }
}

.el-table {
  --el-table-header-text-color: var(--el-text-color-primary);
  --el-table-header-bg-color: var(--el-fill-color-light) !important;

  thead {
    color: var(--el-text-color-regular) !important;
    font-weight: normal !important;

    th.el-table__cell {
      font-weight: normal;
      background: var(--el-fill-color-light);
    }
  }
}

.el-button {
  line-height: 0;
}

.el-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  vertical-align: middle;
  border-radius: 50%;

  &.el-dot-error {
    background: var(--el-color-error);

    span {
      background: var(--el-color-error);
    }
  }

  &.el-dot-success {
    background: var(--el-color-success);

    span {
      background: var(--el-color-success);
    }
  }

  &.el-dot-warning {
    background: var(--el-color-warning);

    span {
      background: var(--el-color-warning);
    }
  }

  &.el-dot-primary {
    background: var(--el-color-primary);

    span {
      background: var(--el-color-primary);
    }
  }

  span {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: dot-scale 1.2s ease-in-out infinite;
  }
}

@keyframes dot-scale {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }

  to {
    transform: scale(2.4);
    opacity: 0;
  }
}

.tree-level {
  .el-icon {
    position: relative;
    z-index: 1;

    &::after {
      position: absolute;
      top: 4px;
      left: 4px;
      z-index: 2;
      display: flex;
      justify-content: center;
      width: 16px;
      height: 16px;
      overflow: hidden;
      font-style: normal;
      text-align: center;
      border-radius: 2px;
      content: '';
    }
  }

  .el-tree-node__expand-icon {
    &::after {
      font-size: 14px;
      line-height: 12px;
      background-color: var(--el-fill-color-blank);
      border: 1px solid var(--el-border-color);
      content: '+';
    }

    &.is-leaf {
      &::after {
        background-color: inherit;
        border: none;
        content: '';
      }
    }

    &.expanded {
      transform: rotate(0deg);

      &::after {
        font-size: 18px;
        line-height: 12px;
        background-color: var(--el-fill-color-blank);
        border: 1px solid var(--el-border-color);
        content: '-';
      }
    }

    svg {
      display: none;
    }
  }

  .el-select-dropdown__item {
    position: static;
  }

  .el-tree-node__content {
    position: relative;
  }

  .item-tree-node {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding-left: 16px;
    line-height: 1;

    .item-tree-node-line-vertical {
      position: absolute;
      top: 0;
      left: 0;
      display: block;
      height: 100%;
      border-left: 1px dashed var(--el-border-color-light);

      &.halfway {
        top: 50%;
        height: 50%;
      }

      &.is-last {
        height: 50%;
      }

      &.is-first {
        top: 50%;
        height: 50%;
      }

      &.is-last.is-first {
        height: 0;
        border-left: none;
      }
    }

    .item-tree-node-line-horizontal {
      position: absolute;
      top: 50%;
      left: 1px;
      display: block;
      width: 17px;
      height: 0;
      border-bottom: 1px dashed var(--el-border-color-light);
    }
  }

  .el-tree-node.disabled {
    &.is-current>.el-tree-node__content {
      background-color: inherit !important;

      &:hover {
        background-color: var(--el-tree-node-hover-bg-color) !important;
      }
    }

    .el-tree-node__content {
      color: var(--el-text-color-disabled);
      cursor: not-allowed;
    }
  }

  .el-tree-node {
    &.is-checked {
      > .el-tree-node__content {
        color: var(--el-color-primary);
        font-weight: bold;
        background-color: var(--el-color-primary-light-9);

        .el-icon {
          font-weight: normal;
        }
      }
    }
  }
}

.el-switch__core .el-switch__inner .is-icon,
.el-switch__core .el-switch__inner .is-text {
  padding: 0 4px;
}

.el-popover.el-popper {
  min-width: 90px !important;
}

.el-tooltip__trigger {
  outline: none !important;
}

.el-popper.is-light {
  background: var(--el-bg-color-overlay);
  border: 1px solid var(--el-border-color-light);
}

.el-popper.is-dark {
  color: var(--el-text-color-primary);
  background: var(--el-bg-color-overlay);
  border: 1px solid var(--el-border-color-lighter);
}

.el-popper.is-dark .el-popper__arrow::before {
  background: var(--el-bg-color-overlay);
  border: 1px solid var(--el-border-color-lighter);
}

.el-collapse-item__wrap,
.el-collapse-item__header {
  background-color: transparent !important;
}
